package com.goodomen.garbage.feign.client;

import com.goodomen.garbage.feign.config.FeignConfig;
import com.goodomen.garbage.feign.fallback.SchedualServiceWebHystric;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;

@Component
@FeignClient(value = "${web.application.name}",configuration = FeignConfig.class, fallback = SchedualServiceWebHystric.class) // 声明一个Feign Client,value为远程调用其他服务的服务名,FeignConfig.class为配置类
public interface GarbageWebClientFeign {

    /**
     * 通过Feign来调用 garbage-web 服务的“/demo/hello”的api接口
     * @return 返回结果
     */
    @GetMapping(value = "/demo/hello")
    String sayHiFromClientEureka();
}
